package renshi.base;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import renshi.utils.DBUtils;
    /**����dao��ĸ���*/
public abstract class BaseDAO {
	/** con Connection ��ݿ�l�Ӷ��� */
	protected Connection con;
	
	/** stmt Statement ����ִ�ж��� */
	protected Statement stmt;
	
	/** pstmt PreparedStatement Ԥ��������ִ�ж��� */
	protected PreparedStatement pstmt;
	
	/** cstmt CallableStatement �洢��̵�������ִ�ж���*/
	protected CallableStatement cstmt;
	
	/** rs ResultSet ���洢 */
	protected ResultSet rs;
	

	/** ��ι��캯���������������ñ�����*/
	public BaseDAO(Connection con){
		this.con = con;	
	}
	/**closeAll�����ر�ResultSet�����Statement����*/
	protected void closeAll(ResultSet rs,Statement stmt) throws SQLException{
		if(rs != null){
			DBUtils.CloseRs(rs);
		}
		if(stmt != null){
			DBUtils.CloseStmt(stmt);
		}
	}
}